package w;
import java.util.Scanner;
import java.util.Random;
public class Price {
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		Random rand=new Random();
		int i,n=0,s;
		s=rand.nextInt(100);
		System.out.println(s);
		System.out.println("Please enter a price");
		for(i=0;i<10;i++)
		{	int input=in.nextInt();
			if(input<s)
			{
				System.out.println("guess it's small,please guess again");
			}
			else if(input>s)
			{
				System.out.println("guess it's big,please guess again");
			}
			else
			{
				System.out.println("it's right");
				System.out.println("the price is "+s);
				return;
			}
			n++;
			System.out.println("You've guessed it "+n+" times");
		}
		System.out.println("the price is "+s);
	}
}
